﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/ThreeColumn.Master"
    AutoEventWireup="true" CodeBehind="Category.aspx.cs" Inherits="CS424_9pts.Category" %>

<%@ Register TagPrefix="nopCommerce" TagName="MiniShoppingCartBox" Src="~/Modules/MiniShoppingCartBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="CategoryNavigation" Src="~/Modules/CategoryNavigation.ascx" %>
<%@ Register Src="Templates/Categories/ProductsInGrid.ascx" TagName="ProductsInGrid"
    TagPrefix="uc" %>
<%--<asp:Content ID="Content2" ContentPlaceHolderID="cph2" runat="server">
    <nopCommerce:CategoryNavigation ID="ctrlCategoryNavigation" runat="server" />
    <div class="clear">
    </div>
    <nopCommerce:ManufacturerNavigation ID="ctrlManufacturerNavigation" runat="server" />
    <div class="clear">
    </div>
    <nopCommerce:RecentlyViewedProducts ID="ctrlRecentlyViewedProducts" runat="server" />
    <div class="clear">
    </div>
</asp:Content>--%>
<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="Server">
    <asp:PlaceHolder runat="server" ID="CategoryPlaceHolder">
        <div class="category-page">
            <%--  <% if (this.SettingManager.GetSettingValueBoolean("Media.CategoryBreadcrumbEnabled"))
       { %>
    <div class="breadcrumb">
        <a href='<%=CommonHelper.GetStoreLocation()%>'>
            <%=GetLocaleResourceString("Breadcrumb.Top")%></a> /
        <asp:Repeater ID="rptrCategoryBreadcrumb" runat="server">
            <ItemTemplate>
                <a href='<%#SEOHelper.GetCategoryUrl(Convert.ToInt32(Eval("CategoryId"))) %>'>
                    <%#Server.HtmlEncode(Eval("LocalizedName").ToString())%></a>
            </ItemTemplate>
            <SeparatorTemplate>
                /
            </SeparatorTemplate>
        </asp:Repeater>
        <br />
    </div>
    <div class="clear">
    </div>
    <% } %>--%>
            <div class="clear">
            </div>
            <div class="clear">
            </div>
            <div class="product-grid">
                <asp:DataList ID="dlProducts" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
                    RepeatLayout="Table" ItemStyle-CssClass="item-box" DataSourceID="CarCategory">
                    <ItemTemplate>
                        <div class="product-item">
                            <h2 class="product-title">
                                <asp:HyperLink ID="hlProduct" runat="server" Text='<%#Eval("ModelName") %>' NavigateUrl="#" />
                            </h2>
                            <div class="picture">
                                <a href="ProductDetail">
                                    <asp:Image ID="hlImageLink" runat="server" ImageUrl='<%#Eval("ImageName") %>' /></a>
                            </div>
                            <div class="description">
                                <asp:Literal runat="server" ID="lShortDescription" Text='<%#Eval("Description") %>'></asp:Literal>
                            </div>
                            <div class="add-info">
                                <div class="prices">
                                    <asp:Label ID="lblOldPrice" runat="server" CssClass="oldproductPrice" Text='<%#Eval("Price") %>' />
                                    <br />
                                    <asp:Label ID="lblPrice" runat="server" CssClass="productPrice" Text='<%#Eval("Price") %>' />
                                </div>
                                <div class="buttons">
                                    <asp:Button runat="server" ID="btnProductDetails" Text="Details" ValidationGroup="ProductDetails"
                                        CssClass="productgridproductdetailbutton" /><br />
                                     <a href="ShoppingCart.aspx?ModelID=<%#Eval("ModelID") %>&BrandID=<%#Eval("BrandID") %>"><asp:Button runat="server" ID="btnAddToCart" Text="Add To Cart" ValidationGroup="ProductDetails" OnClick="btnAddToCart_Click"
                                        CssClass="productgridaddtocartbutton" /></a>
                                    <%--<a href="ShoppingCart.aspx?">
                                        <asp:Button runat="server" ID="btnAddToCart" Text="Add To Cart" ValidationGroup="ProductDetails"
                                            OnClick="btnAddToCart_Click" CssClass="productgridaddtocartbutton" /></a>--%>
                                </div>
                            </div>
                        </div>
                    </ItemTemplate>
                </asp:DataList>
            </div>
            <div class="clear">
            </div>
            <div class="product-pager">
                <%--<uc:Pager runat="server" ID="productsPager" FirstButtonText="First"
            LastButtonText="Last" NextButtonText="Next"
            PreviousButtonText="Previous" CurrentPageText="Pager.CurrentPage" />--%>
            </div>
        </div>
    </asp:PlaceHolder>
    <asp:SqlDataSource ID="CarCategory" runat="server" ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>"
        SelectCommand="SELECT CarModel.Price, CarModel.ModelName, CarModel.ImageName, CarModel.SpectableID, CarModel.Transmission, CarModel.Brake, CarModel.Fuel, CarModel.Engine, CarModel.BrandID, CarModelDetail.Description, CarModel.ModelID FROM CarModel INNER JOIN CarModelDetail ON CarModel.ModelID = CarModelDetail.ModelID WHERE (CarModel.BrandID = @BrandID)">
        <SelectParameters>
            <asp:QueryStringParameter Name="BrandID" QueryStringField="BrandID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
